﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;

namespace drukowanie
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            PrintDocument pd = new PrintDocument();
            pd.DocumentName = "test";
            pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
            pd.Print();
        }

        void pd_PrintPage(object sender, PrintPageEventArgs e)
        {
            e.Graphics.DrawString("abc fasdfasjdfajksdflasd\n asdfasdfasdfasd", new Font("Arial", 16), Brushes.Black, new Point(50, 50));
            e.Graphics.DrawString("abc fasdfasjdfajksdflasd\n asdfasdfasdfasd", new Font("Arial", 16), Brushes.Black, new Point(70, 70));
        }
    }
}